//
// Created by lymk on 2022/2/26.
//

#ifndef SOFTRENDER_BUFFER_H
#define SOFTRENDER_BUFFER_H
#include <vector>

class Buffer {
    unsigned char* data;
    int width;
    int height;
    int nChannels;
public:
    unsigned char *getData() const;

    void setData(unsigned char *data);

    int getWidth() const;

    void setWidth(int width);

    int getHeight() const;

    void setHeight(int height);

    int getNChannels() const;

    void setNChannels(int nChannels);

    Buffer();
    Buffer(int w,int h,int c);
    std::vector<unsigned char> GetElement(int i,int j);
    void SetElement(int i,int j,std::vector<unsigned char> element);
    void Clear();
};

struct DepthBuffer{
    float* DepthValue;
    int width;
    int height;
public:
    DepthBuffer(int w,int h);
    float getDepth(int i,int j);
    void setDepth(int i,int j,float value);
    void Clear();
};


#endif //SOFTRENDER_BUFFER_H
